package com.example.mobile2121606110syc0409homework;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import java.util.Scanner;

public class MainActivity2 extends AppCompatActivity {


    private TextView tvMainTit21;
    private TextView tvMainTit22;
    private TextView tvMainTit23;
    private EditText edtTtPN21;
    private TextView tvMainTit24;
    private EditText edtTtPN22;
    private TextView tvMainTit25;
    private EditText edtTtPN23;
    private Button btnMainjs2;
    private TextView tvMainTit26;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        initView();
        btnMainjs2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Scanner scanner=new Scanner(System.in);
                int a=Integer.parseInt(edtTtPN21.getText().toString());;
                int b=Integer.parseInt(edtTtPN22.getText().toString());
                int c=Integer.parseInt(edtTtPN23.getText().toString());
                int max_num=a;
                if (b>max_num)
                {
                    max_num=b;
                }
                if (c>max_num)
                {
                    max_num=c;
                }
                tvMainTit26.setText(String.valueOf(max_num));
            }
        });
    }

    private void initView() {
        tvMainTit21 = (TextView) findViewById(R.id.tvMainTit21);
        tvMainTit22 = (TextView) findViewById(R.id.tvMainTit22);
        tvMainTit23 = (TextView) findViewById(R.id.tvMainTit23);
        edtTtPN21 = (EditText) findViewById(R.id.edtTtPN21);
        tvMainTit24 = (TextView) findViewById(R.id.tvMainTit24);
        edtTtPN22 = (EditText) findViewById(R.id.edtTtPN22);
        tvMainTit25 = (TextView) findViewById(R.id.tvMainTit25);
        edtTtPN23 = (EditText) findViewById(R.id.edtTtPN23);
        btnMainjs2 = (Button) findViewById(R.id.btnMainjs2);
        tvMainTit26 = (TextView) findViewById(R.id.tvMainTit26);
    }
}